package com.ruoyi.yipaiju.controller;

import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.yipaiju.domain.ForeclosedHouseBookingorderFollower;
import com.ruoyi.yipaiju.service.IForeclosedHouseBookingorderFollowerService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;

/**
 * fo_foreclosed_house_bookingorder_followerController
 * 
 * @author liuwp
 * @date 2023-03-01
 */
@RestController
@RequestMapping("/yipaiju/foreclosed_house_bookingorder_follower")
public class ForeclosedHouseBookingorderFollowerController extends BaseController
{
    @Autowired
    private IForeclosedHouseBookingorderFollowerService foreclosedHouseBookingorderFollowerService;

    /**
     * 查询fo_foreclosed_house_bookingorder_follower列表
     */
    @PreAuthorize("@ss.hasPermi('yipaiju:foreclosed_house_bookingorder_follower:list')")
    @GetMapping("/list")
    public TableDataInfo list(ForeclosedHouseBookingorderFollower foreclosedHouseBookingorderFollower)
    {
        startPage();
        List<ForeclosedHouseBookingorderFollower> list = foreclosedHouseBookingorderFollowerService.selectForeclosedHouseBookingorderFollowerList(foreclosedHouseBookingorderFollower);
        return getDataTable(list);
    }

    /**
     * 导出fo_foreclosed_house_bookingorder_follower列表
     */
    @PreAuthorize("@ss.hasPermi('yipaiju:foreclosed_house_bookingorder_follower:export')")
    @Log(title = "fo_foreclosed_house_bookingorder_follower", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, ForeclosedHouseBookingorderFollower foreclosedHouseBookingorderFollower)
    {
        List<ForeclosedHouseBookingorderFollower> list = foreclosedHouseBookingorderFollowerService.selectForeclosedHouseBookingorderFollowerList(foreclosedHouseBookingorderFollower);
        ExcelUtil<ForeclosedHouseBookingorderFollower> util = new ExcelUtil<ForeclosedHouseBookingorderFollower>(ForeclosedHouseBookingorderFollower.class);
        util.exportExcel(response, list, "fo_foreclosed_house_bookingorder_follower数据");
    }

    /**
     * 获取fo_foreclosed_house_bookingorder_follower详细信息
     */
    @PreAuthorize("@ss.hasPermi('yipaiju:foreclosed_house_bookingorder_follower:query')")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id)
    {
        return AjaxResult.success(foreclosedHouseBookingorderFollowerService.selectForeclosedHouseBookingorderFollowerById(id));
    }

    /**
     * 新增fo_foreclosed_house_bookingorder_follower
     */
    @PreAuthorize("@ss.hasPermi('yipaiju:foreclosed_house_bookingorder_follower:add')")
    @Log(title = "fo_foreclosed_house_bookingorder_follower", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody ForeclosedHouseBookingorderFollower foreclosedHouseBookingorderFollower)
    {
        return toAjax(foreclosedHouseBookingorderFollowerService.insertForeclosedHouseBookingorderFollower(foreclosedHouseBookingorderFollower));
    }

    /**
     * 修改fo_foreclosed_house_bookingorder_follower
     */
    @PreAuthorize("@ss.hasPermi('yipaiju:foreclosed_house_bookingorder_follower:edit')")
    @Log(title = "fo_foreclosed_house_bookingorder_follower", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody ForeclosedHouseBookingorderFollower foreclosedHouseBookingorderFollower)
    {
        return toAjax(foreclosedHouseBookingorderFollowerService.updateForeclosedHouseBookingorderFollower(foreclosedHouseBookingorderFollower));
    }

    /**
     * 删除fo_foreclosed_house_bookingorder_follower
     */
    @PreAuthorize("@ss.hasPermi('yipaiju:foreclosed_house_bookingorder_follower:remove')")
    @Log(title = "fo_foreclosed_house_bookingorder_follower", businessType = BusinessType.DELETE)
	@DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids)
    {
        return toAjax(foreclosedHouseBookingorderFollowerService.deleteForeclosedHouseBookingorderFollowerByIds(ids));
    }
}
